package com.Ajava1801D.并发包.CountDownLunch;

import java.util.concurrent.CountDownLatch;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/7  15:20
 * 描述:
 */
public class TestRun2222 implements Runnable {

    private CountDownLatch countDownLatch;


    private int sends;

    public TestRun2222(CountDownLatch countDownLatch, int sends) {
        this.countDownLatch = countDownLatch;
        this.sends = sends;
    }

    @Override
    public void run() {

        try {
            Thread.sleep(sends*1000);
            System.out.println("============"+Thread.currentThread().getName());
            countDownLatch.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
